package pub

import (
	"strings"

	"github.com/gin-gonic/gin"
)

func ReqErr(c *gin.Context, err error, desc ...string) bool {
	if err == nil {
		return false
	}

	if len(desc) > 0 {
		errMsg := strings.Join(desc, ",")
		Resp(c, nil, errMsg)
	}

	return true
}
